import { request } from '@/utils'

export function info(id) {
  return request({
    url: `/sys/dept/${id}`,
    method: 'get',
  })
}

export function list(params) {
  return request({
    url: `/sys/dept`,
    method: 'get',
    params,
  })
}

export function tree(params) {
  return request({
    url: `/sys/dept/tree`,
    method: 'get',
    params,
  })
}

export function add(data) {
  return request({
    url: `/sys/dept`,
    method: 'post',
    data,
  })
}

export function edit(data) {
  return request({
    url: `/sys/dept`,
    method: 'put',
    data,
  })
}

export function del(id) {
  return request({
    url: `/sys/dept/${id}`,
    method: 'delete',
  })
}
